<?php

class Category extends BaseCategory
{
	public function setName($name)
	{
		parent::setName($name);
		   
		$this->setSlug(ToolRental::slugify($name));
	}

	public function getAllProducts()
	{
		$criteria = new Criteria();

		$criteria->add(ProductPeer::CATEGORY_ID, $this->getId());
		$criteria->addAscendingOrderByColumn(ProductPeer::NAME);

		return ProductPeer::doSelect($criteria);
	}
}
